Assemble projects into a sceneΒΆ
Gather animation
Bring animation files into the scene using mod.createref
.
You can have as many animation references as needed (for instance,
one reference for each character or prop, or several files in case
the animation work was split, or a single file for the whole
animation.
local mod = Document:modify ()
-- using prefixnodes=false, we make sure the animation comes in
-- the exact same way it was generated
mod.createref ("Animation", "/prod/shot1001/animation/anim.abc", nil, {prefixnodes=false})
With multiple files:
local mod = Document:modify ()
mod.createref ("girl", "/prod/shot1001/animation/girl.abc", nil, {containschildren=true,prefixnodes=false})
mod.createref ("dog", "/prod/shot1001/animation/dog.abc", nil, {containschildren=true,prefixnodes=false})
Or, if each geometry archive is baked without prefix:
local mod = Document:modify ()
mod.createref ("girl", "/prod/shot1001/animation/girl.abc", nil, {containschildren=false,prefixnodes=true})
mod.createref ("dog", "/prod/shot1001/animation/dog.abc", nil, {containschildren=false,prefixnodes=true})
to mimic Maya references layout.
Gather shading
Bring Guerilla shading projects into the scene using
mod.createref ()
.
Note that Guerilla shading projects usually contain
more than was is really needed (RenderPasses, Lights, etc.)
You can either delete these using mod.deletenode ()
:
local mod = Document:modify ()
local ref, roots = mod.createref ("girl", "/prod/assets/girl/shading.gproject")
for k, node in pairs (roots) do
if not is_useful (node) then
mod.deletenode (node)
end
end
or by flagging these nodes as non-referenceable
local mod = Document:modify ()
for node in children (Document, "Node") do
if not is_useful (node) then
-- create the Referenceable plug if it doesn't exist
if not node.Referenceable then
mod.createplug("Plug", node, "Referenceable", Plug.Dynamic, types.bool, true)
end
-- force its value to false
mod.set(node.Referenceable,false)
end
end